<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="s"  uri="/struts-tags"%>

<s:if test='FLAG=="DOING"'>
	<title>打印提前还款凭证</title><span id="navlink">贷后管理  >> 打印提前还款凭证</span>
</s:if>
<s:if test='FLAG=="DONE"'>
	<title>完成提前还款凭证</title><span id="navlink">贷后管理  >> 完成提前还款凭证</span>
</s:if>

<table class="table_box table_bottom_border" cellspacing="0" cellpadding="0">
	<tr>
		<th>合同编号</th>
		<th>借款人名称</th>
		<th>放款序号</th>
		<th>放款日期</th>
		<th>放款金额</th>
		<s:if test='FLAG=="DOING"'>
		<th style="width:200px">操作</th>
		</s:if>
	</tr>
<s:iterator value="contractList" status="index" var="var">
	<tr>
		<td align="center">${contractId}</td>
		<td align="center">${customname}</td>
		<td align="center">${grantnum}</td>
		<td align="center"><s:text name="f.date.ymdc"><s:param value="grantdate"/></s:text></td>
		<td align="right"><s:text name="f.money"><s:param value="grantmoney"/></s:text></td>
		<s:if test='FLAG=="DOING"'>
		<td align="center" id="${id}">
			<input type="button" class="printChange" value="生成凭证" />
			<input type="button" class="print" value="打印预览" />
			<input type="button" class="printsure" value="确认" />
		</td>
		</s:if>
	</tr>
</s:iterator>
</table>
<div id="button_area"><div class="pagebar"></div></div>

<script type="text/javascript">
$(".print").click(function(){
	$thisid=$(this).parent("td").attr("id");
	//OpenDialog(750,450,"打印预览","creditPrint!printIn?id="+$thisid);
	window.open("creditPrint!printIn?type=do&id="+$thisid,'newwindow','height=450px, width=750px, scrollbars=no, resizable=no');
});
$(".printChange").click(function(){
	$thisid=$(this).parent("td").attr("id");
	OpenDialog(750,450,"修改","../creditmanage/creditPrint!printIn?type=change&id="+$thisid);
});
$(".printsure").click(function(){
	$thisid=$(this).parent("td").attr("id");
	OpenDialog(750,450,"确认","../creditmanage/creditPrint!printIn?type=sure&id="+$thisid);
});


$(".printdone").click(function(){
	$thisid=$(this).parent("td").attr("id");
	MessageDialog("./creditIn!aheadChange?id="+$thisid,"确认打印完成？","");
});
</script>
